<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<body>
		<select name="sele" id="all">
			<option value="0">选择大小</option>
			<option value ="da">大</option>
			<option value ="xiao">小</option>
		</select>
		<br>
		<img src="img/1.jpg" id="img1">
		<br>
		
		<button type="button" onclick="starts()">开始</button>
	</body>
	<script type="text/javascript">
		function starts(){
			var a = document.getElementById('all');
			if(a.value=='0'){
				alert('请选择大小');
			}
			var allimg = document.getElementById("img1");
				var num=0;
				var aa = setInterval(function(){
				var arrone = allarr();
				allimg.src="img/"+arrone+".jpg";
				num++;
				if(num=15){
					clearInterval(aa);
					var k=arrone;
					if((k<=3 && a.value=='xiao') || (k>3 && a.value=='da')){
						alert('你猜对了');
					}
					else{
						alert('你猜错了');
					}
				}
			},1000)
		}
			
		
		function allarr(){
			while(true){
				var arrone = Math.ceil(Math.random()*10);
				if(arrone!=7 && arrone!=8 && arrone!=9 && arrone!=10 ){
					return arrone;
				}
			}
		}
	
	</script>
</html>
